package com.edu.compile;

import com.edu.compile.template.ModuleTemplateModel;

public interface BaseModule {

    enum Module {

        INNER_CLASS(1, "module-inner-class"),
        TOOLS(2, "module-tools"),
        INTERCEPTOR(3, "module-interceptor"),
        REDIS_POOL(4, "module-redis-pool"),
        AXIOS(5, "module-axios"),
        FS(6, "module-fs"),
        ;

        Module(int type, String name) {
            this.type = type;
            this.name = name;
        }

        private int type;

        private String name;

        public int getType() {
            return type;
        }

        public String getName() {
            return name;
        }
    }


    /**
     * 获取module
     *
     * @return
     */
    Module getModule();

    /**
     * 解析module
     *
     * @return
     * @see ModuleTemplateModel
     */
    String parseModule();

    /**
     * 返回module是否唯一
     *
     * @return
     */
    default boolean onlyOne() {
        return true;
    }
}
